package com.dolphin.serviceorder.remote;

import com.dolphin.common.dto.PriceRule;
import com.dolphin.common.dto.ResponseResult;
import com.dolphin.common.request.PriceRuleIsNewRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("service-price")
public interface ServicePriceClient {

    @PostMapping("/price-rule/is-new")
    ResponseResult<Boolean> isNew(@RequestBody PriceRuleIsNewRequest priceRuleIsNewRequest);
    @GetMapping("/price-rule/if-exists")
    ResponseResult<Boolean> ifExists(@RequestBody PriceRule priceRule);

    @PostMapping("/calculate-price")
    ResponseResult<Double> calculatePrice(@RequestParam Integer distance,
                                         @RequestParam Integer duration,
                                         @RequestParam String cityCode,
                                         @RequestParam String vehicleType
    );

}
